package com.asialjim.wechat.apiservice;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.File;
import java.io.Serializable;

/**
 * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
 * <h2>CLASS DESCRIPTION <i>[ NAME: com.asialjim.wechat.api.ApiRequest ]</i></h2><strong>
 * <p> we-chat api request
 * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
 *
 * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
 * @version 1.0.0
 * @since 2021/3/1   &nbsp;&nbsp; JDK 8
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ApiRequest {
    private RequestUrlParam requestUrlParam;
    private RequestBodyParam requestBodyParam;

    /**
     * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
     * <h2>CLASS DESCRIPTION <i>[ NAME: com.asialjim.wechat.api.ApiRequest.RequestUrlParam ]</i></h2><strong>
     * <p> the url parameter entity without access token for we-chat api
     * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
     * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
     * @since 2021/3/1   &nbsp;&nbsp; JDK 8
     * @version 1.0.0
     */
    public static interface RequestUrlParam extends Serializable{ }

    /**
     * <h1><em>ASIAL JIM JAVA DOC</em></h1><hr/>
     * <h2>CLASS DESCRIPTION <i>[ NAME: com.asialjim.wechat.api.ApiRequest.RequestBodyParam ]</i></h2><strong>
     * <p> the parameter body for we-chat api
     * </strong><p><p><em>Copyright &copy; Asial Jim Co., LTD</em><hr/>
     * @author Asial Jim &nbsp;&nbsp; <span>Email:<a href="mailto:asialjim@hotmail.com">asialjim@hotmail.com</a> &nbsp;&nbsp; <a href="asialjim@qq.com">asialjim@qq.com</a></span>
     * @since 2021/3/1   &nbsp;&nbsp; JDK 8
     * @version 1.0.0
     */
    public static interface RequestBodyParam extends Serializable{

        /**
         * <h3>METHOD DESCRIPTION <i>[ NAME: file ]</i></h3>
         * if api function is upload some file such as image,voice,video,doc,excel,.etc. , override this method
         * @return {@link File file}
         * @author Asial Jim &nbsp;&nbsp;<span>Email:asialjim@hotmail.com &nbsp;&nbsp; asialjim@qq.com</span>
         * @since 2021/3/2 9:37
         */
        default File file(){
            return null;
        }

        /**
         * <h3>METHOD DESCRIPTION <i>[ NAME: uploadFileName ]</i></h3>
         * if api function is upload some file such as image,voice,video,doc,excel,.etc. , and the upload file name is not 'media', just override this method
         * <p><em><b>NOTICE: the upload file name is not the name of {@link #file() file}, but the api need name</b></em>
         * @return {@link String upload file name}
         * @author Asial Jim &nbsp;&nbsp;<span>Email:asialjim@hotmail.com &nbsp;&nbsp; asialjim@qq.com</span>
         * @since 2021/3/2 9:47
         */
        default String uploadFileName(){
            return "media";
        }
    }
}